<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
     <title>Suusavõistlus</title>
     <meta http-equiv="Content-Type" content="text/html; 
charset=iso-8859-1" />
 </head>
 <body>
 <h1> Suusavõistlusele registreerimine</h1>
 
   <?php
    $yhendus=new mysqli("localhost", "if11", "4e3HtHTXGXQC8uas", "if11_m47");
	 if(isSet($_REQUEST["voistleja"])){
		$kask=$yhendus->prepare("INSERT INTO suusavoistlus (voistleja) VALUES (?)");
		$kask->bind_param("s", $_REQUEST["voistleja"]);
		$kask->execute();
		header("Location: $_SERVER[PHP_SELF]");
		$yhendus->close();
	
    exit();
	}
	
	
   ?>
   
<form action="?registreerimine=1" method="post">
      Võistleja nimi: <input type="text" name="voistleja" />
      
      <input type="submit" value="Sisesta" />
   </form>
 </body>
</html>
